Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit tests for Xcode 16 and older iOS destinations #3537

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pyrtsa
Copy link
Contributor

@pyrtsa pyrtsa commented Dec 16, 2024

This PR makes the necessary changes to make the test suite build and pass on Xcode 16 (tested on 16.2) on at least the following destinations:

  • macOS 15.2
  • iPhone 16 simulator running iOS 18.2
  • iPhone 15 simulator running iOS 17.5
  • iPhone 14 simulator running iOS 16.4

(Unfortunately I can't seem to pass the test suite on iPhone 13 simulator running iOS 15.5, as several test cases seem to crash with EXC_BAD_ACCESS at static Shared<A>.== infix(_:_:). 🤷‍♂️)

Code coverage on the perception checking logic is slightly improved by not skipping the test even if running on iOS 17+.

I think these changes should be enough to enable running adding test to matrix.strategy on the xcodebuild-latest job in ci.yml.

@pyrtsa pyrtsa force-pushed the testing-on-xcode-16 branch from 32f56fa to 6ddfa1b Compare December 17, 2024 09:24
@pyrtsa pyrtsa force-pushed the testing-on-xcode-16 branch from 6ddfa1b to ee03593 Compare December 17, 2024 10:30
@pyrtsa
Copy link
Contributor Author

pyrtsa commented Dec 20, 2024

There's at least one flaky test, recordAndPlayback() in VoiceMemos, which I did not address in this PR.

Occasionally, TestClock fails to megaYield enough for another timerUpdated action to get a chance to be sent. It's easy to reproduce by defining the environment variable TASK_MEGA_YIELD_COUNT=1 during the unit test execution.

Failing test output

Link to CI output of forked repo.

✘ Test recordAndPlayback() recorded an issue at VoiceMemosTests.swift:79:24: Issue recorded
↳ Received unexpected action: …
    VoiceMemos.Action.voiceMemos(
      .element(
        id: URL(file:///tmp/DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF.m4a),
        action: .audioPlayerClient(
          .success(true)
        )
      )
    )
✘ Test recordAndPlayback() recorded an issue at VoiceMemosTests.swift:82:24: Issue recorded
↳ Expected to receive an action matching case path, but didn't get one.
✘ Test recordAndPlayback() recorded an issue at VoiceMemosTests.swift:85:24: Issue recorded
↳ Expected to receive an action matching case path, but didn't get one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant